pxyhosts="r16.Millennium.Berkeley.EDU
r17.Millennium.Berkeley.EDU
r18.Millennium.Berkeley.EDU
r19.Millennium.Berkeley.EDU
r20.Millennium.Berkeley.EDU
r21.Millennium.Berkeley.EDU
r22.Millennium.Berkeley.EDU
r23.Millennium.Berkeley.EDU
r24.Millennium.Berkeley.EDU
r25.Millennium.Berkeley.EDU
r26.Millennium.Berkeley.EDU
r27.Millennium.Berkeley.EDU
r28.Millennium.Berkeley.EDU
r29.Millennium.Berkeley.EDU
r30.Millennium.Berkeley.EDU
r31.Millennium.Berkeley.EDU
r32.Millennium.Berkeley.EDU
r34.Millennium.Berkeley.EDU
r35.Millennium.Berkeley.EDU
r36.Millennium.Berkeley.EDU
r37.Millennium.Berkeley.EDU
r38.Millennium.Berkeley.EDU
r58.Millennium.Berkeley.EDU"

pxy=5001
while read host ; do
  ssh -ND 127.0.0.1:$pxy -o BatchMode=yes $host &
  pxy=$((pxy+1))
done <<< "$pxyhosts"

# == filter key-auth hosts ==
#cat $1 | while read host; do
#echo $host
#ssh -n -o BatchMode=yes $host exit
#[ $? -eq 0 ] && echo $host >> $1.good
#done
